/*
 * @Description: file content
 */
var express = require('express');
const NewsController = require('../../controllers/admin/NewsController');
var NewsRouter = express.Router();
// 图片上传
const multer = require('multer')
const upload = multer({ dest: 'public/newsuploads/' })

NewsRouter.post('/adminApi/news/add', upload.single('file'), NewsController.add);
NewsRouter.get('/adminApi/news/list', NewsController.getList);//获取列表
NewsRouter.post('/adminApi/news/list',  upload.single('file'),NewsController.updateOne);//更新列表
NewsRouter.delete('/adminApi/news/list/:id', NewsController.delOne);//删除一个
NewsRouter.get('/adminApi/news/list/:id', NewsController.getList);//根据id获取

NewsRouter.put('/adminApi/news/publish', NewsController.publish);//发布

module.exports = NewsRouter;
